import React, { Component } from 'react';
import PropTypes from 'prop-types';
import { NavLink } from 'react-router-dom';
import SettingStyle from '@/page/setting/setting.scss';
import { Menu, Dropdown, Icon, Table, Button, Pagination } from 'antd';
const columns = [{
    title: '全选消息',
    dataIndex: 'message'
}];
const testData1 = [];
for (let i = 0; i < 6; i++) {
    testData1.push({
        key: i,
        message: `消息内容消息内容1`
    });
}
const testData2 = [];
for (let i = 0; i < 6; i++) {
    testData2.push({
        key: i,
        message: `消息内容消息内容2`
    });
}
const testData3 = [];
for (let i = 0; i < 6; i++) {
    testData3.push({
        key: i,
        message: `消息内容消息内容3`
    });
}
class MessageCheckBox extends Component {
    state = {
        selectedRowKeys: [], // Check here to configure the default column
        loading: false,
        tableLoading: false,
        data: testData1
    };
    componentDidMount = () => {
        this.setState({
            data: testData1
        })
    };
    pageOnChange = e => {
        setTimeout(() => {
            this.setState({
                tableLoading: true,
                data: testData2
            });
            this.setState({
                tableLoading: false
            })
        }, 1000);
    };
    start = () => {
        this.setState({ loading: true });
        // ajax request after empty completing
        setTimeout(() => {
            this.setState({
                selectedRowKeys: [],
                loading: false,
                tableLoading: false
            });
        }, 1000);
    };
    onSelectChange = (selectedRowKeys) => {
        console.log('selectedRowKeys changed: ', selectedRowKeys);
        this.setState({ selectedRowKeys });
    };
    render() {
        const { loading, selectedRowKeys } = this.state;
        const rowSelection = {
            selectedRowKeys,
            onChange: this.onSelectChange
        };
        const pagination = {
            pageSize: 7
        };
        const hasSelected = selectedRowKeys.length > 0;
        return (
            <div className={SettingStyle['table-wrap']} style={{ fontSize: '14px' }}>
                <Table rowSelection={rowSelection} loading={this.state.tableLoading} pagination={false} columns={columns} dataSource={this.state.data} />
            </div>
        );
    }
}

export default MessageCheckBox;